import Vue from 'vue'
import Router from 'vue-router'

import Layout from '@/views/Layout'
import Login from '@/views/Login'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    },

    {
      path: '/',
      component: Layout,
      children: [
        // 首页
        {
          path: '/home',
          name: 'Home',
          component: () => import('@/views/Home/Home'),
          meta: { title: 'CRM' },
          alias: '/'
        },
        {
          path: '/home/address',
          name: 'Address',
          component: () => import('@/views/Home/Address'),
          meta: { title: '通讯录' }
        },
        {
          path: '/home/notice',
          name: 'Notice',
          component: () => import('@/views/Home/Notice'),
          meta: { title: '公告' }
        },
        {
          path: '/home/task',
          name: 'Task',
          component: () => import('@/views/Home/Task'),
          meta: { title: '任务下达' }
        },

        // 轮播图
        {
          path: '/carousel/set',
          name: 'CarouselSet',
          component: () => import('@/views/Carousel/CarouselSet'),
          meta: { title: '轮播图设置' }
        },
       
        // 文章管理
        {
          path: '/article',
          name: 'article',
          component: () => import('@/views/Article/ArticleSet'),
          meta: { title: '文章管理' }
        },

        // 送货管理
        {
          path: '/delivery/staff',
          name: 'staff',
          component: () => import('@/views/Delivery/StaffManage'),
          meta: { title: '员工管理' }
        },

        // 会员管理
        {
          path: '/member/manageData',
          name: 'manageData',
          component: () => import('@/views/Member/ManageData'),
          meta: { title: '会员管理' }
        },
        {
          path: '/member/relationData',
          name: 'Relationship',
          component: () => import('@/views/Member/RelationData'),
          meta: { title: '会员关系' }
        },
        {
          path: '/member/bill',
          name: 'BillData',
          component: () => import('@/views/Member/BillData'),
          meta: { title: '会员账单' }
        },
        {
          path: '/member/withdraw',
          name: 'WithdrawData',
          component: () => import('@/views/Member/WithdrawData'),
          meta: { title: '提现管理' }
        },
        {
          path: '/member/grade',
          name: 'GradeData',
          component: () => import('@/views/Member/GradeData'),
          meta: { title: '等级记录' }
        },
        {
          path: '/member/reward',
          name: 'RewardData',
          component: () => import('@/views/Member/RewardData'),
          meta: { title: '分享奖励记录' }
        },
        {
          path: '/member/recharge',
          name: 'RechargeData',
          component: () => import('@/views/Member/RechargeData'),
          meta: { title: '充值记录' }
        },

        // 订单管理
        {
          path: '/order',
          name: 'OrderDetails',
          component: () => import('@/views/Order/OrderDetails'),
          meta: { title: '订单详情' }
        },

        // 商品管理
        {
          path: '/commodity/classification',
          name: 'Classification',
          component: () => import('@/views/Commodity/Classification'),
          meta: { title: '商品管理' }
        }
        // {
        //   path: '/base-table',
        //   name: 'BaseTable',
        //   component: () => import('@/views/Template/BaseTable'),
        //   meta: { title: '基础表格' }
        // },
        // {
        //   path: '/base-form',
        //   name: 'BaseForm',
        //   component: () => import('@/views/Template/BaseForm'),
        //   meta: { title: '基础表单' }
        // },
        // {
        //   path: '/base-editor',
        //   name: 'BaseEditor',
        //   component: () => import('@/views/Template/BaseEditor'),
        //   meta: { title: '富文本' }
        // }
      ]
    }
  ]
})
